using PaintAWorld.PlayerInputs;
using ZFramework;

namespace PaintAWorld
{
    public class Player : WorldObject
    {
        public Vec3 lookEuler = Vec3.Zero;

        public Vec3 Position { get; set; }

        public Player(WorldLogic world, Vec3 position) : base(world)
        {
            Position = position;
        }

        public void HandleInput(IPlayerInputContent content)
        {
            switch (content)
            {
                case Move m:
                    Position = m.position;
                    break;
                
                case SetVoxel set:
                    World.SetVoxel(set.voxelPos, set.color);
                    break;

                case RemoveVoxel rm:
                    World.RemoveVoxel(rm.voxelPos);
                    break;
            }
        }
    }
}